{{useCss "/app-pages/css/user/info.scss"}}
<div class="mainbox">
    <div class="typetitle">{{$Cache.user.info.title}}</div>
    <div class="pinfo {{$Cache.user.info.title=='基本信息'?'':'hidden'}}">
        <img class="logo" bind-src="{{loginer.info.header_url||'/images/anonymous.jpg'}}?imageView/1/w/120">
        <img-uploader 
            upload-server-url="{{config.other.upload_image}}" 
            text="选择头像图片" 
            bind-input-key="loginer.info.header_url" 
            one-way="true" 
            style="display:inline-block;vertical-align: middle;" 
            max-width="200"
        ></img-uploader>
        <L:input class="focus" placeholder="用户名(不允许更改)" disabled="disabled" value="{{loginer.info.name}}"></L:input>
        <L:input placeholder="昵称" bind-input="{{'loginer.info.nick_name'}}" value="{{loginer.info.nick_name}}"></L:input>
        <L:input class="focus" placeholder="手机" bind-input="{{'loginer.info.mobile_phone'}}" value="{{loginer.info.mobile_phone}}"></L:input>
        <L:input class="focus" placeholder="邮箱" bind-input="{{'loginer.info.email'}}" value="{{loginer.info.email}}"></L:input>
        <L:input placeholder="身份证" bind-input="{{'loginer.info.id_card'}}" value="{{loginer.info.id_card}}"></L:input>
        <L:input placeholder="支付宝账号"  value="{{loginer.info.alipay}}" bind-input="{{'loginer.info.alipay'}}"></L:input>

        <button class="btn" event-click="{{'$Event.user.info.post_edit_user_info'}}">提交修改</button>
    </div>

    <div class="pinfo {{$Cache.user.info.title=='密码管理'?'':'hidden'}}">
        <L:input type="password" placeholder="输入当前密码" value="{{$Cache.user.info.changepwd.current_pwd}}" bind-input="{{'$Cache.user.info.changepwd.current_pwd'}}"></L:input>
        <L:input type="password" placeholder="输入新密码" bind-input="{{'$Cache.user.info.changepwd.new_pwd'}}" value="{{$Cache.user.info.changepwd.new_pwd}}" maxlength="16"></L:input>
        <L:input type="password" placeholder="再次输入新密码" bind-input="{{'$Cache.user.info.changepwd.new_pwd_bak'}}" value="{{$Cache.user.info.changepwd.new_pwd_bak}}" maxlength="16"></L:input>
        <button class="btn" event-click="{{'$Event.user.info.changepwd.change'}}">提交修改</button>
    </div>

    <div class="pinfo {{$Cache.user.info.title=='收货地址'?'':'hidden'}}">
        <div>{{$Cache.user.info.isremove&&'点击删除地址'||'点击地址可更改默认地址'}}</div>
        {{#each $Cache.user.info.address_detail}}
        <div class="addritem {{#if $Top.loginer.default_ua_id===_id}}focus{{/if}} {{$Top.$Cache.user.info.isremove&&' remove'}}" event-click="{{#if $Top.$Cache.user.info.isremove}}{{'$Top.$Event.user.info.remove_address'}}{{#else}}{{'$Top.$Event.user.info.set_default_address'}}{{/if}}">
            {{name}}，{{mobilenumber}}，{{phonenumber&&("/"+phonenumber)}}，{{province}},{{town}},{{county}}，{{detail}}
        </div>
        {{/each}}
        <button class="btn" event-click="{{'$Event.user.info.addaddr'}}">{{$Cache.user.info.isnew&&'取消'||'增加地址'}}</button>
        <button class="btn" event-click="{{'$Event.user.info.removeaddr'}}">{{$Cache.user.info.isremove&&'取消'||'删除地址'}}</button>
        <div class="newaddr {{$Cache.user.info.isnew&&'focus'}}">
            <select class="province" name="province" event-change={{ '$Event.province'}}>
                <option class="first" value="0">省</option>
                {{#each city_list}}
                <option rel="{{region_id}}" value="{{region_name}}">
                    {{region_name}}
                </option>
                {{/each}}
            </select>

            <select class="city" name="city" disabled event-change={{ '$Event.city'}}>
                <option class="first" value="0">市</option>
            </select>

            <select class="county" name="area" disabled>
                <option class="first" value="0">地区</option>
            </select>
            <L:input name="detailed_addre" placeholder="详细地址"></L:input>
            <L:input name="name" placeholder="收货人"></L:input>
            <L:input name="mobile_num" placeholder="手机"></L:input>
            <button class="btn" event-click="{{'$Event.user.info.add_user_address'}}">确定</button>
        </div>
    </div>
</div>
